home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 261 / SOMC Family Forum 261.iso / Xtras / Behavior Library.cst / 00021_Script_Sound Play Castmember < prev    next >
Text File  |  1997-11-17  |  2KB  |  57 lines

  1. --  Sound Play Member
  2.  
  3. -- also functions through lingo by handling message 'initPlayMember', 
  4. -- for example if this behavior was assigned to sprite 5, use
  5. -- sendsprite 5, #initPlayMember
  6.  
  7. -- Media
  8. -- behavior library version 1.1
  9.  
  10. property WhichEvent, WhichSound, WhichChannel, StartImmediately
  11. property tester
  12.  
  13. on initPlayMember me
  14.   init me
  15. end
  16.  
  17.  
  18. on mouseUp me
  19.   if whichEvent = #mouseup    then init me
  20. end
  21.  
  22. on mouseDown me
  23.   if whichEvent = #mousedown  then init me
  24. end
  25.  
  26. on prepareFrame me
  27.   if whichEvent = #prepareframe then init me
  28. end
  29.  
  30. on enterFrame me
  31.   if whichEvent = #enterframe then init me
  32. end
  33.  
  34. on exitFrame me
  35.   if whichEvent = #exitframe  then init me
  36. end
  37.  
  38. on init me
  39.   puppetSound the WhichChannel of me, the whichSound of me
  40.   if the StartImmediately of me then updatestage
  41. end
  42.  
  43. ---
  44.  
  45. on getPropertyDescriptionList
  46.   
  47.   set p_list = [           #WhichSound: [ #comment:   "Sound:",                           #format:   #sound,                          #default:   "" ],         #WhichChannel: [ #comment:   "Channel:",                           #format:   #integer,                          #default:    1 ],           #WhichEvent: [ #comment:   "Initializing Event:",                           #format:   #symbol,                            #range: [ #MouseUp, #MouseDown, #PrepareFrame, #EnterFrame, #ExitFrame, #InitPlayMember ],                          #default:   #MouseUp ]                 ]
  48.   return p_list
  49.   
  50. end
  51.  
  52. on getBehaviorDescription
  53.   return "Plays the designated sound cast member when the specified event occurs, or when the message ." & RETURN & "PARAMETERS:" & RETURN & "ò Sound - Choose the sound cast member to be played."  & RETURN & "ò Channel - Enter the sound channel number to be used for playback."  & RETURN & "ò Initializing Event - Specify the event that triggers the behavior."
  54.   
  55. end
  56.  
  57.